package cn.brickie.abstractfactory;

/***
 * 抽象工厂具体实现
 * 基于给定的信息生成实体类的对象。
 * @author Brickie
 * @date 2018/5/29 10:47
 */
public class ColorFactory extends AbstractFactory {

    @Override
    public Shape getShape(ShapeFactory.ShapeType shapeType) {
        return null;
    }

    @Override
    public Color getColor(ColorType colorType) {
        switch (colorType) {
            case RED:
                return new Red();
            case BLUE:
                return new Blue();
            case GREEN:
                return new Green();
            default:
                return null;
        }
    }

    enum ColorType {
        RED,
        GREEN,
        BLUE
    }
}